<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
    <meta name="author" content="">
    <title></title>  <link rel="icon" href="/template/pc1/images/wmh_favicon.ico" type="image/x-icon" />
    <% include("../inc/input_css.html"){}%>
    <style>
        label{
            width: 140px!important;
        }
    </style>
    <%
		var isAdd = false;
		var isEdit = false;
		if(isEmpty(productCategory.id)){
		isAdd = true;
		}else{
		isEdit = true;
    }%>
</head>
<body>
<div class="ibox">
    <div class="ibox-title">
        <div class="pull-left mbx navbar_title">
            <span class="current">商品管理</span>
            <span class="line">/</span>
            <span class="current"><a href="list">商品类型</a></span><span class="line">/</span>
            <%if(isAdd){%>添加商品分类<%}else{%>编辑商品分类<%}%>
        </div>
    </div>
    <div class="ibox-content">
        <div class="wrapper wrapper-content">
            <div class="row">
                <div class="padding-40">
                    <form  action="<%if (isAdd){%>save<%}else{%>update<%}%>" method="post" class="form-horizontal form-validate">
                        <input type="hidden" name="productCategory.id" value="${productCategory.id!}" />
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><span class="maroon">*</span>分类名称</label>
                            <div class="col-sm-3">
                                <input type="text" name="productCategory.name" id="productCategoryName" value="${productCategory.name!}" class="form-control light-input" maxlength="10" required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">链接地址</label>
                            <div class="col-sm-3">
                                <input type="text"  name="productCategory.linkurl"  value="${productCategory.linkurl!}" class="form-control light-input" maxlength="10">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">分类图片</label>
                            <div class="col-sm-3">
                                <input type="hidden" name="productCategory.image" value="" class="pull-left form-control light-input"/>
                                <img class="img-rounded" src="${productCategory.image!}" style="max-height:50px;"/>
                                <input type="button" class="button browserButton" value="选择文件"/>
                                <span class="help-block"><span class="maroon"></span>建议300*300像素；格式jpg</span>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">上级分类</label>
                            <div class="col-sm-3">
                                <%if(isAdd){%>

                                <select name="parentId" class="form-control light-input" style="height: 31px">
                                    <option value="">顶级分类</option>
                                    <%for(list in productCategoryTreeList){%>
                                    <option value="${list.id}">
                                        <%if (list.level != 0){%>
                                        <%for( i in range(0,list.level)){%>------<%}%>
                                        <%}%>
                                        ${list.name}
                                    </option>
                                    <%}%>
                                </select>
                                <%}else{%>
                                ${productCategory.parent.name!'顶级分类'}
                                <%}%>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label"><span class="maroon">*</span>排序</label>
                            <div class="col-sm-3">
                                <input type="text" name="productCategory.orderList"  value="${productCategory.orderList!50}" class="form-control light-input" maxlength="10" required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">页面关键词</label>
                            <div class="col-sm-3">
                                <input type="text"  name="productCategory.metaKeywords"  value="${productCategory.metaKeywords!}" class="form-control light-input" maxlength="10">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">页面描述</label>
                            <div class="col-sm-3">
                                <textarea name="productCategory.metaDescription"  rows="5" style="" class="form-control light-input">${productCategory.metaDescription!}</textarea>
                            </div>
                        </div>

                        <div class="form-group" style="margin-top: 24px">
                            <label class="col-sm-2 control-label "></label>
                            <div class="col-sm-4 col-sm-offset-0">
                                <button class="hive-btn-cancle" id="btn_cancle" type="button" onclick="history.back()">&nbsp;取消&nbsp;</button>
                                <button class="hive-btn hive-btn-primary margin-left-8" type="submit">&nbsp;提交&nbsp;
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

</body>
<% include("../inc/input_js.html"){}%>
<script type="text/javascript">
    var uploadUrl="/file/uploadfile?shopId=${shopId!}&type=d";
    var browserUrl="/file/browser?shopId=${shopId!}";
</script>
<script src="https://static.9hive.cn/global/vendor/file/file.js"></script>
<script type="text/javascript">
    $(function () {
        $("input.browserButton").browser();
        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_flat-blue',
            radioClass: 'iradio_flat-blue',
        });

    })
</script>
</html>
